package content;

import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.List;

import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.input.SAXBuilder;

public class ReaderXml {

	public List<String> list1 = new ArrayList<String>();
	public List<String> list2 = new ArrayList<String>();

	public ReaderXml() {

		try {

			File f = new File("c:\\PageXmlDefault.xml");
			FileInputStream fin = new FileInputStream(f);
			SAXBuilder bud = new SAXBuilder();
			Document doc = bud.build(fin);

			Element root = doc.getRootElement();

			Element el0 = null;

			List<Element> li0 = root.getChildren();
			for (int i = 0; i < li0.size(); i++) {
				el0 = (Element) li0.get(i);

				list1.add(el0.getAttributeValue("linkpageindex"));
				list2.add(el0.getAttributeValue("pagename"));

			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
